package com.halloon.android.ui.activity;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;

import com.halloon.android.R;
import com.halloon.android.ui.fragment.LBSContactFragment;
import com.halloon.android.ui.fragment.LBSContactFragment.LBSContactFragmentCallback;
import com.halloon.android.ui.fragment.TabMyContactsFragment;
import com.halloon.android.ui.fragment.TabMyContactsFragment.ContactsFragmentCallback;

public class MyContactsActivity extends BaseMultiFragmentActivity implements LBSContactFragmentCallback,
                                                                             ContactsFragmentCallback{
	
	@Override
	protected Fragment onCreatePane() {
		mFragmentContainer.add(new TabMyContactsFragment());

		return getFragmentDec(1);
	}
	
	@Override
	public void setupLBSContactFragment(){
		mFragmentContainer.add(new LBSContactFragment());
		FragmentManager fragmentManager = getSupportFragmentManager();
		FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
		fragmentTransaction.setCustomAnimations(R.anim.fragment_slide_right_enter, 
				                                R.anim.fragment_slide_left_exit, 
				                                R.anim.fragment_slide_left_enter, 
				                                R.anim.fragment_slide_right_exit);
		fragmentTransaction.add(R.id.root_container, getFragmentDec(1));
		fragmentTransaction.hide(getFragmentDec(2));
		fragmentTransaction.addToBackStack(null);
		fragmentTransaction.commit();
	}

	@Override
	public void destroyLBSFragment(){
		backStackAction();
	}

}
